import cv2
# 1.找到路径
import numpy as np

path = "./1.jpg"
img = cv2.imread(path)
print(img.shape)
# 绘制线条
# 线条位置，起点，终点，颜色，粗细
cv2.line(img=img,pt1=(100,100),pt2=(200,200),color=(0,0,255),thickness=2)
# 绘制矩形
cv2.rectangle(img,(100,100),(200,200),(0,0,0),2)
# 绘制圆
cv2.circle(img,(100,100),100,(0,0,0),2)
pts = np.array([[100,200],[150,180],[200,300],[230,320]])
cv2.polylines(img,pts=[pts],isClosed=False,color=(255,0,0),thickness=2)
cv2.imshow('img',img)
cv2.waitKey(0)
cv2.destroyAllWindows()